# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=u3-pwn
pkgver=2.0
pkgrel=9
groups=('blackarch' 'blackarch-backdoor')
pkgdesc='A tool designed to automate injecting executables to Sandisk smart usb devices with default U3 software install.'
url="http://www.nullsecurity.net/tools/backdoor.html"
arch=('any')
license=('GPL3')
depends=('python2' 'cdrkit' 'u3-tool' 'metasploit')
source=("https://github.com/nullsecuritynet/tools/raw/main/backdoor/$pkgname/release/$pkgname-$pkgver.tar.gz")
sha512sums=('cc8e9928e78ffc29ea06d2b584250763d73d48cc87e31204f1e44e78dc482be06cc35c248266e94e693a364509a09ec04765e29e967377469afbebc3cef657ec')

package() {
  cd "$pkgname.$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 u3-pwn.py
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

